package com.caseProcess.controller;

import com.caseProcess.entity.Result;
import com.caseProcess.entity.VUrging;
import com.caseProcess.service.VUrgingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author duzq
 * @date 2020/11/15 20:46
 **/
@RestController
@RequestMapping("/vurging")
public class VUrgingController {

    @Autowired
    private VUrgingService vUrgingService;

    /**
     * 查询具体分派的所有催办过程
     * @param processId
     * @return
     * 催办列表页用到
     */
    @RequestMapping("/selectVUrgings")
    private Result selectVUrgings(String processId){
        Result result = new Result();
        VUrging vUrging = new VUrging();
        vUrging.setProcessId(processId);
        List<VUrging> vUrgingsList= vUrgingService.selectVUrgings(vUrging);
        if (vUrgingsList.size() > 0){
            result.setCode(Result.RESULT_OK);
            result.setMsg("查询催办信息成功");
            result.setCount(vUrgingsList.size());
            result.setData(vUrgingsList);
        }else if (vUrgingsList.size() == 0) {
        result.setCode(Result.RESULT_OK);
        result.setMsg("暂未被催办");
        }else {
        result.setCode(Result.RESULT_ERROR);
        result.setMsg("操作失败");
    }
        return result;
    }
}

